package com 
{
	import flash.display.Loader;
	import flash.display.MovieClip;
	import flash.events.Event;
	import flash.net.URLRequest;
	
	/**
	 * ...
	 * @author Mohan Patil
	 */
	public class Image extends MovieClip 
	{
		private var imageLoader:Loader = new Loader();
		
		
		public function Image(path:String) 
		{
			imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onImageLoaded);
			var fileRequest:URLRequest=new URLRequest(path);
			imageLoader.load(fileRequest);
		}
		
		private function onImageLoaded(e:Event)
		{
			this.addChild(imageLoader);
			imageLoader.x = 0;
			//imageLoader.y = this.height / 2 - imageLoader.height / 2;
			imageLoader.y = 0;
		}
		
	}

}